<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>CAD-Tool: /home/manish/Desktop/Manish_CAD_Tool/src/body_loop.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CAD-Tool
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">body_loop.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="faceloop__generator_8h_source.html">include/faceloop_generator.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="general__methods_8h_source.html">include/general_methods.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="planar__graph__generator_8h_source.html">include/planar_graph_generator.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="body__loop_8h_source.html">include/body_loop.h</a>&quot;</code><br />
<code>#include &lt;cmath&gt;</code><br />
<code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;map&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for body_loop.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="body__loop_8cpp__incl.png" border="0" usemap="#_2home_2manish_2_desktop_2_manish___c_a_d___tool_2src_2body__loop_8cpp" alt=""/></div>
<map name="_2home_2manish_2_desktop_2_manish___c_a_d___tool_2src_2body__loop_8cpp" id="_2home_2manish_2_desktop_2_manish___c_a_d___tool_2src_2body__loop_8cpp">
<area shape="rect" id="node2" href="faceloop__generator_8h.html" title="include/faceloop_generator.h" alt="" coords="197,191,385,218"/>
<area shape="rect" id="node6" href="general__methods_8h.html" title="include/general_methods.h" alt="" coords="461,273,638,300"/>
<area shape="rect" id="node7" href="planar__graph__generator_8h.html" title="include/planar_graph\l_generator.h" alt="" coords="31,184,172,225"/>
<area shape="rect" id="node8" href="body__loop_8h.html" title="include/body_loop.h" alt="" coords="354,109,491,136"/>
<area shape="rect" id="node3" href="structs_8h.html" title="structs.h" alt="" coords="334,348,407,375"/>
<area shape="rect" id="node4" href="_full__plane_8h.html" title="Full_plane.h" alt="" coords="190,273,282,300"/>
</map>
</div>
</div>
<p><a href="body__loop_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a71064b70dc7b2e65c2aa8a0555cf2efd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#a71064b70dc7b2e65c2aa8a0555cf2efd">epsil</a>&#160;&#160;&#160;0.000001</td></tr>
<tr class="separator:a71064b70dc7b2e65c2aa8a0555cf2efd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a598a3330b3c21701223ee0ca14316eca"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#a598a3330b3c21701223ee0ca14316eca">PI</a>&#160;&#160;&#160;3.14159265</td></tr>
<tr class="separator:a598a3330b3c21701223ee0ca14316eca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a230720d5c9d1a2805c6c743287d28d5b"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classbody__loop.html">body_loop</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#a230720d5c9d1a2805c6c743287d28d5b">generate_body_loop</a> (std::vector&lt; <a class="el" href="classface__loop.html">face_loop</a> &gt; face_loop_list, std::vector&lt; <a class="el" href="classvertex__3d.html">vertex_3d</a> &gt; v3d_list)</td></tr>
<tr class="separator:a230720d5c9d1a2805c6c743287d28d5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85f5918713a8c62784797c5766195628"><td class="memItemLeft" align="right" valign="top">pair&lt; int, bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#a85f5918713a8c62784797c5766195628">successive_face_loop</a> (std::vector&lt; <a class="el" href="classface__loop.html">face_loop</a> &gt; face_loop_list, <a class="el" href="classface__loop.html">face_loop</a> fl, int fl_int, bool side, <a class="el" href="classedge__3d.html">edge_3d</a> e, std::vector&lt; <a class="el" href="classvertex__3d.html">vertex_3d</a> &gt; v3d_list, bool inner_basic)</td></tr>
<tr class="separator:a85f5918713a8c62784797c5766195628"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9a0c6603771f19b48cb31a570811386"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#af9a0c6603771f19b48cb31a570811386">initialize_side_used</a> (std::vector&lt; pair&lt; bool, bool &gt; &gt; &amp;side_used)</td></tr>
<tr class="memdesc:af9a0c6603771f19b48cb31a570811386"><td class="mdescLeft">&#160;</td><td class="mdescRight">function that initializes side_used for both sides + and - for every body loop  <a href="#af9a0c6603771f19b48cb31a570811386">More...</a><br /></td></tr>
<tr class="separator:af9a0c6603771f19b48cb31a570811386"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad211473d1c05d9bfce31774964bbd9a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#aad211473d1c05d9bfce31774964bbd9a">check_legality</a> (<a class="el" href="classbody__loop.html">body_loop</a> bl)</td></tr>
<tr class="memdesc:aad211473d1c05d9bfce31774964bbd9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">function that checks that if a body part generated is legal or not  <a href="#aad211473d1c05d9bfce31774964bbd9a">More...</a><br /></td></tr>
<tr class="separator:aad211473d1c05d9bfce31774964bbd9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68ebe3fd8487bbca7800bd67b4386970"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#a68ebe3fd8487bbca7800bd67b4386970">inner_outer</a> (<a class="el" href="classbody__loop.html">body_loop</a> bp, std::vector&lt; <a class="el" href="classvertex__3d.html">vertex_3d</a> &gt; v3d_list)</td></tr>
<tr class="memdesc:a68ebe3fd8487bbca7800bd67b4386970"><td class="mdescLeft">&#160;</td><td class="mdescRight">function that determines if give body loop is inner or outer  <a href="#a68ebe3fd8487bbca7800bd67b4386970">More...</a><br /></td></tr>
<tr class="separator:a68ebe3fd8487bbca7800bd67b4386970"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8e1589cd5ef438b41ebcce9fc970049"><td class="memItemLeft" align="right" valign="top">std::vector&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="body__loop_8cpp.html#ad8e1589cd5ef438b41ebcce9fc970049">get_ray_l</a> (<a class="el" href="classplane.html">plane</a> p1, <a class="el" href="classplane.html">plane</a> p2, bool s1, bool s2)</td></tr>
<tr class="memdesc:ad8e1589cd5ef438b41ebcce9fc970049"><td class="mdescLeft">&#160;</td><td class="mdescRight">function that determines vector along ray l = /|n1| + /|n2|, where @ is the corresponding side  <a href="#ad8e1589cd5ef438b41ebcce9fc970049">More...</a><br /></td></tr>
<tr class="separator:ad8e1589cd5ef438b41ebcce9fc970049"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a71064b70dc7b2e65c2aa8a0555cf2efd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define epsil&#160;&#160;&#160;0.000001</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00006">6</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a598a3330b3c21701223ee0ca14316eca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PI&#160;&#160;&#160;3.14159265</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00007">7</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aad211473d1c05d9bfce31774964bbd9a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool check_legality </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbody__loop.html">body_loop</a>&#160;</td>
          <td class="paramname"><em>bl</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>function that checks that if a body part generated is legal or not </p>

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00160">160</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a230720d5c9d1a2805c6c743287d28d5b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt; <a class="el" href="classbody__loop.html">body_loop</a> &gt; generate_body_loop </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="classface__loop.html">face_loop</a> &gt;&#160;</td>
          <td class="paramname"><em>face_loop_list</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="classvertex__3d.html">vertex_3d</a> &gt;&#160;</td>
          <td class="paramname"><em>v3d_list</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">face_loop_list</td><td>list of all face loops generated for the reconstruction </td></tr>
    <tr><td class="paramname">v3d_list</td><td>vector of the 3d-vertices of the 3D object </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00033">33</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ad8e1589cd5ef438b41ebcce9fc970049"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;float&gt; get_ray_l </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classplane.html">plane</a>&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classplane.html">plane</a>&#160;</td>
          <td class="paramname"><em>p2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>s1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>s2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>function that determines vector along ray l = /|n1| + /|n2|, where @ is the corresponding side </p>

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00187">187</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af9a0c6603771f19b48cb31a570811386"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initialize_side_used </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; pair&lt; bool, bool &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>side_used</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>function that initializes side_used for both sides + and - for every body loop </p>

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00152">152</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a68ebe3fd8487bbca7800bd67b4386970"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool inner_outer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classbody__loop.html">body_loop</a>&#160;</td>
          <td class="paramname"><em>bp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="classvertex__3d.html">vertex_3d</a> &gt;&#160;</td>
          <td class="paramname"><em>v3d_list</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>function that determines if give body loop is inner or outer </p>

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00180">180</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a85f5918713a8c62784797c5766195628"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">pair&lt;int,bool&gt; successive_face_loop </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="classface__loop.html">face_loop</a> &gt;&#160;</td>
          <td class="paramname"><em>face_loop_list</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classface__loop.html">face_loop</a>&#160;</td>
          <td class="paramname"><em>fl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fl_int</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>side</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classedge__3d.html">edge_3d</a>&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="classvertex__3d.html">vertex_3d</a> &gt;&#160;</td>
          <td class="paramname"><em>v3d_list</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>inner_basic</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">face_loop_list</td><td>list of all face loops of the object </td></tr>
    <tr><td class="paramname">fl</td><td>face loop for which successive face loop is being found </td></tr>
    <tr><td class="paramname">side</td><td>side of the face loop (i.e + or -) </td></tr>
    <tr><td class="paramname">e</td><td>edge of the face loop fl at which successive face loop has to be found </td></tr>
    <tr><td class="paramname">e_vector</td><td>3*1 vector for direction of the edge e </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the index of successive face loop and its side </dd></dl>

<p>Definition at line <a class="el" href="body__loop_8cpp_source.html#l00111">111</a> of file <a class="el" href="body__loop_8cpp_source.html">body_loop.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
